package com.aids_malaria.http.response;

import android.arch.persistence.room.Embedded;
import android.arch.persistence.room.Entity;
import android.arch.persistence.room.PrimaryKey;
import android.support.annotation.NonNull;

import com.aids_malaria.http.request.TokenDrug;
import com.aids_malaria.util.GsonUtil;
import com.litesuits.orm.db.annotation.NotNull;
import com.litesuits.orm.db.enums.AssignType;

import java.io.Serializable;

@Entity(tableName = "getMedicalTreatmentPack",primaryKeys = {"identity_code","record_no","record_seq"})
public class GetMedicalTreatmentPack implements Serializable {

//    @PrimaryKey(AssignType.BY_MYSELF)
    @NonNull
    private String identity_code;
    private int record_seq;
    private int medicine_taken_type; //服药类型
    private String medicine_taken_time;// 服药时间
    @Embedded
    private TokenDrug taken_drags; // 服用药物
    private String taken_drags_json;
    private int is_hospital; // 是否住院
    private String hospital_no; //  住院号
    private String hospital_in_time;// 住院时间;
    private String hospital_outs_time; // 出院时间
    private String medicint_access; //获取药物方式
    private String investor; // 调查人员
    private String create_time;
    private String update_time;
    private int record_no;

    private boolean createOrUpdate;

    public boolean isCreateOrUpdate() {
        return createOrUpdate;
    }

    public void setCreateOrUpdate(boolean createOrUpdate) {
        this.createOrUpdate = createOrUpdate;
    }

    public static GetMedicalTreatmentPack copyFromNoPack(GetMedicalTreatment getMedicalTreatment){
        GetMedicalTreatmentPack getMedicalTreatmentPack = new GetMedicalTreatmentPack();
        getMedicalTreatmentPack.setIdentity_code(getMedicalTreatment.getIdentity_code());
        getMedicalTreatmentPack.setRecord_seq(getMedicalTreatment.getRecord_seq());
        getMedicalTreatmentPack.setMedicine_taken_type(getMedicalTreatment.getMedicine_taken_type());
        getMedicalTreatmentPack.setMedicine_taken_time(getMedicalTreatment.getMedicine_taken_time());
        getMedicalTreatmentPack.setIs_hospital(getMedicalTreatment.getIs_hospital());
        getMedicalTreatmentPack.setHospital_no(getMedicalTreatment.getHospital_no());
        getMedicalTreatmentPack.setHospital_in_time(getMedicalTreatment.getHospital_in_time());
        getMedicalTreatmentPack.setHospital_outs_time(getMedicalTreatment.getHospital_outs_time());
        getMedicalTreatmentPack.setMedicint_access(getMedicalTreatment.getMedicint_access());
        getMedicalTreatmentPack.setInvestor(getMedicalTreatment.getInvestor());
        getMedicalTreatmentPack.setCreate_time(getMedicalTreatment.getCreate_time());
        getMedicalTreatmentPack.setUpdate_time(getMedicalTreatment.getUpdate_time());
        getMedicalTreatmentPack.setRecord_no(getMedicalTreatment.getRecord_no());

        String taken_drags = getMedicalTreatment.getTaken_drags();
        getMedicalTreatmentPack.setTaken_drags_json(taken_drags);
        TokenDrug tokenDrug = GsonUtil.gsonToBean(taken_drags, TokenDrug.class);
        getMedicalTreatmentPack.setTaken_drags(tokenDrug);

        return getMedicalTreatmentPack;
    }

    private int busy_type;

    public int getBusy_type() {
        return busy_type;
    }

    public void setBusy_type(int busy_type) {
        this.busy_type = busy_type;
    }

    public String getTaken_drags_json() {
        return taken_drags_json;
    }

    public void setTaken_drags_json(String taken_drags_json) {
        this.taken_drags_json = taken_drags_json;
    }

    public String getIdentity_code() {
        return identity_code;
    }

    public void setIdentity_code(String identity_code) {
        this.identity_code = identity_code;
    }

    public int getRecord_seq() {
        return record_seq;
    }

    public void setRecord_seq(int record_seq) {
        this.record_seq = record_seq;
    }

    public int getMedicine_taken_type() {
        return medicine_taken_type;
    }

    public void setMedicine_taken_type(int medicine_taken_type) {
        this.medicine_taken_type = medicine_taken_type;
    }

    public String getMedicine_taken_time() {
        return medicine_taken_time;
    }

    public void setMedicine_taken_time(String medicine_taken_time) {
        this.medicine_taken_time = medicine_taken_time;
    }

    public TokenDrug getTaken_drags() {
        return taken_drags;
    }

    public void setTaken_drags(TokenDrug taken_drags) {
        this.taken_drags = taken_drags;
    }

    public int getIs_hospital() {
        return is_hospital;
    }

    public void setIs_hospital(int is_hospital) {
        this.is_hospital = is_hospital;
    }

    public String getHospital_no() {
        return hospital_no;
    }

    public void setHospital_no(String hospital_no) {
        this.hospital_no = hospital_no;
    }

    public String getHospital_in_time() {
        return hospital_in_time;
    }

    public void setHospital_in_time(String hospital_in_time) {
        this.hospital_in_time = hospital_in_time;
    }

    public String getHospital_outs_time() {
        return hospital_outs_time;
    }

    public void setHospital_outs_time(String hospital_outs_time) {
        this.hospital_outs_time = hospital_outs_time;
    }

    public String getMedicint_access() {
        return medicint_access;
    }

    public void setMedicint_access(String medicint_access) {
        this.medicint_access = medicint_access;
    }

    public String getInvestor() {
        return investor;
    }

    public void setInvestor(String investor) {
        this.investor = investor;
    }

    public String getCreate_time() {
        return create_time;
    }

    public void setCreate_time(String create_time) {
        this.create_time = create_time;
    }

    public String getUpdate_time() {
        return update_time;
    }

    public void setUpdate_time(String update_time) {
        this.update_time = update_time;
    }

    public int getRecord_no() {
        return record_no;
    }

    public void setRecord_no(int record_no) {
        this.record_no = record_no;
    }

    @Override
    public String toString() {
        return "GetMedicalTreatmentPack{" +
                "identity_code='" + identity_code + '\'' +
                ", record_seq=" + record_seq +
                ", medicine_taken_type=" + medicine_taken_type +
                ", medicine_taken_time='" + medicine_taken_time + '\'' +
                ", taken_drags=" + taken_drags +
                ", is_hospital=" + is_hospital +
                ", hospital_no='" + hospital_no + '\'' +
                ", hospital_in_time='" + hospital_in_time + '\'' +
                ", hospital_outs_time='" + hospital_outs_time + '\'' +
                ", medicint_access='" + medicint_access + '\'' +
                ", investor='" + investor + '\'' +
                ", create_time='" + create_time + '\'' +
                ", update_time='" + update_time + '\'' +
                ", record_no=" + record_no +
                '}';
    }
}
